<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>保险销售互联平台</title>
<link rel="icon" href="image/favicon.jpg">
<!-- Bootstrap core CSS -->
<link href="third/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<!-- Custom styles for this template -->
<link href="css/signin.css" rel="stylesheet">
<!-- import md5 encrypt -->
<script src="third/md5.js"></script>
<script src="third/vue/vue.js"></script>
<script src="third/vue/vue-resource.js"></script>
</head>
  <body class="text-center">
    <form id="login" class="form-signin">
      <img class="mb-4" src="image/index.jpeg" alt="" width="100" height="100">
      <h1 class="h3 mb-3 font-weight-normal">Please sign in</h1>
      <label for="inputEmail" class="sr-only">Email address</label>
      <input type="email" v-model="email" id="inputEmail" class="form-control" placeholder="Email address" required autofocus>
      <label for="inputPassword" class="sr-only">Password</label>
      <input type="password" v-model="password" id="inputPassword" class="form-control" placeholder="Password" required>
      <div class="checkbox mb-3">
        <label>
          <input type="checkbox" value="remember-me"> Remember me
        </label>
      </div>
      <button class="btn btn-lg btn-primary btn-block" type="submit" v-on:click="OnLogin">Sign in</button>
      <p></p>
      <label>
        <h4><a href="signup.html">注册账号</a></h4>
      </label>
      <p class="mt-5 mb-3 text-muted">&copy; 2017-2018</p>
    </form>
    
    <script type="text/javascript">
	    var vm = new Vue({  
	        el: '#login',  
	        data: {  
	        	email:"",
	        	password:""
	        },  
	        methods: {  
	            OnLogin: function() {
                  // 加密为md5
                  this.password = hex_md5(this.password);
                  let data = {};
                  data.email = this.email;
                  data.password = this.password;
                  console.log(data);
                  this.$http.post("/springboot/login", data ).then((result) => {
                    console.log(result);
                  }).catch((err) => {
                    console.log("Error");
                  });;
	            }
	        },  
	    })
    </script>
  </body>
</html>